﻿using System.Collections.Generic;
using System.Web.Http;
using AttributeRouting;
using AttributeRouting.Web.Http;
using AutoFacWrapper;
using ZLWeb.WebApiEntity.EasyQuery;
using ZLWeb.WebApiEntity.EasyUse;
using ZLWeb.WebApiRepository.InterFace;

namespace ZLWeb.WebApiControllers.Controllers
{
    [RoutePrefix("Api/EasyQuery")]
    public class EasyQueryController : ApiController
    {
        [GET("GetCustInfo")]
        public CustInfoResponse GetCustInfo(string openid)
        {
            var repository = ClassFactory.GetInstance<ICustInfoRepository>();
            return repository.GetCustInfo(openid);
        }
        [GET("GetJfChanges")]
        public AccOprInfoResponse GetJfChanges(string openid)
        {
            var repository = ClassFactory.GetInstance<IAccOprInfoRepository>();
            return new AccOprInfoResponse() { AccOprInfos = repository.GetJfChanges(openid)};
        }

        [GET("GetBalanceChanges")]
        public AccOprInfoResponse GetBalanceChanges(string openid)
        {
            var repository = ClassFactory.GetInstance<IAccOprInfoRepository>();
            return new AccOprInfoResponse() { AccOprInfos = repository.GetBalanceChanges(openid) };
        }
        

    }
}